import VueRouter from 'vue-router'


//导入4个组件
import home from './components/home.vue'
import member from './components/member.vue'
import shopcart from './components/shopcart.vue'
import search from './components/search.vue'
import newsList from './components/news/newsList.vue'
import newsInfo from './components/news/newsInfo.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
      { path: '/', redirect: '/home'},
      { path: '/home', component: home},
      { path: '/member', component: member},
      { path: '/shopcart', component: shopcart},
      { path: '/search', component: search},
      { path: '/home/newslist', component: newsList},
      { path: '/home/newsinfo', component: newsInfo}
  ],
  linkActiveClass: 'mui-active'//将router提供的默认router-link-active类名改为mui-active（mui提供高亮类名）
})

// 把路由对象暴露出去
export default router